<template>
  <div>app</div>
</template>

<script setup>
const xhr=new XMLHttpRequest()
const url="http://localhost:8510/api/cms/banner"
xhr.open("GET",url)
xhr.onreadystatechange=()=>{
  if(xhr.readyState==4){
    if(xhr.status>=200&&xhr.status<300){
      const result=JSON.parse(xhr.responseText)
      console.log(result)
    }else{
      alert(`请求失败，错误信息为：${xhr.statusText}`)
    }
  }
}
xhr.send()
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
